<template>
  <div class="qyui-cell row">
    <el-form v-if="manager.states.tableIndex>-1" label-width="100px">
      <el-form-item label="名称">
        <el-select v-model="manager.states.tableIndex" style="width:160px">
          <template v-for="(item,index) in manager.Body.AllGridViews" :key="item.Name">
            <el-option :value="index" :label="item.Name"></el-option>
          </template>
        </el-select>
      </el-form-item>
      <el-form-item label="数据集">
        <el-select v-model="manager.Body.AllGridViews[manager.states.tableIndex].dataSourceName" style="width:160px">
          <template v-for="item in manager.allDataSets" :key="item.ID">
            <el-option :value="item.Name" :label="item.Name">
            </el-option>
          </template>
        </el-select>
      </el-form-item>
      <el-form-item label="图层">
        <el-input v-model="manager.Body.AllGridViews[manager.states.tableIndex].ZIndex" style="width:160px"></el-input>
      </el-form-item>
      <el-form-item label="左边距">
        <el-input-number
          v-model="manager.Body.AllGridViews[manager.states.tableIndex].Left" :step="3" step-strictly :controls="false" style="width:160px"
        ></el-input-number>
      </el-form-item>
      <el-form-item label="上边距">
        <el-input-number
          v-model="manager.Body.AllGridViews[manager.states.tableIndex].Top" :step="3" step-strictly :controls="false" style="width:160px"
        ></el-input-number>
      </el-form-item>
      <el-form-item label="布局是否隐藏">
        <el-input style="width:160px" :model-value="manager.Body.AllGridViews[manager.states.tableIndex].GridHidden">
          <template #append>
            <el-button icon="Search" @click="handleEditExpression()" />
          </template></el-input>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
export default {
  inject: ['manager'],
  methods: {
    expCallBack(pim, psm, param) {
      this.manager.Body.AllGridViews[this.manager.states.tableIndex].GridHidden = pim;
      this.manager.Body.AllGridViews[this.manager.states.tableIndex].GridHiddenPsm = psm;
      this.manager.Body.AllGridViews[this.manager.states.tableIndex].GridHiddenParam = param;
    },
    handleEditExpression() {
      this.manager.expCallBack = this.expCallBack;
      this.manager.states.EditExpression = this.manager.Body.AllGridViews[this.manager.states.tableIndex].GridHidden;
      this.manager.states.EditExpressionVisible = true;
    },
  },

};
</script>

<style>

</style>
